Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypervisor forward progress: prevent ITLB miss fault PTW thrashing DCache #3004

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

ingallsj
Copy link
Contributor

@ingallsj ingallsj commented Jul 2, 2022

Related issue:

This is a bug in the hypervisor implementation populating htval2 starting from ebe27d6.

The core isn’t making forward progress because the ITLB is thrashing (it only has one copy of the GPA register, hence can’t support multiple speculative accesses that each need their own GPAs). The resulting ITLB misses result in D$ conflict misses, which prevent an older load instruction from making progress.

The bug can only manifest when executing within a guest. When not using the hypervisor extension, it can’t occur.

The RTL fix is to disable speculative ITLB refill unless recent forward progress has been made (perf impact should be imperceptible).

Andrew was able to demonstrate the bug can occur with both direct-mapped and 2-way associativity. His test case couldn’t trip the bug on 4-way, which isn’t proof the bug can’t manifest on 4-way, but at minimum, it’s rarer, though.

Type of change: bug report

Impact: functional fix for forward progress, hopefully minimal-to-no performance degradation

Development Phase: implementation quoting both RTL and explanation from @aswaterman

Release Notes
Speculative ITLB misses under Hypervisor thrash in D$, preventing an older load from making forward progress. Fix is to prevent speculative ITLB misses unless recent forward progress has been made.

@ingallsj ingallsj requested a review from aswaterman July 2, 2022 17:57
@ingallsj ingallsj merged commit 0d0fa90 into master Jul 5, 2022
@ingallsj ingallsj deleted the hypervisor_itlb_progress branch July 5, 2022 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants